

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>argoverse.visualization.colormap &mdash; argoverse  documentation</title>
  

  
  
  
  

  
  <script type="text/javascript" src="../../../_static/js/modernizr.min.js"></script>
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script type="text/javascript" src="../../../_static/jquery.js"></script>
        <script type="text/javascript" src="../../../_static/underscore.js"></script>
        <script type="text/javascript" src="../../../_static/doctools.js"></script>
        <script type="text/javascript" src="../../../_static/language_data.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    

  
  <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
    <link rel="index" title="Index" href="../../../genindex.html" />
    <link rel="search" title="Search" href="../../../search.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../../../index.html" class="icon icon-home"> argoverse
          

          
          </a>

          
            
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <!-- Local TOC -->
              <div class="local-toc"></div>
            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../index.html">argoverse</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../../index.html">Docs</a> &raquo;</li>
        
          <li><a href="../../index.html">Module code</a> &raquo;</li>
        
      <li>argoverse.visualization.colormap</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <h1>Source code for argoverse.visualization.colormap</h1><div class="highlight"><pre>
<span></span><span class="c1"># Copyright (c) 2017-present, Facebook, Inc.</span>
<span class="c1">#</span>
<span class="c1"># Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
<span class="c1"># you may not use this file except in compliance with the License.</span>
<span class="c1"># You may obtain a copy of the License at</span>
<span class="c1">#</span>
<span class="c1">#     http://www.apache.org/licenses/LICENSE-2.0</span>
<span class="c1">#</span>
<span class="c1"># Unless required by applicable law or agreed to in writing, software</span>
<span class="c1"># distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
<span class="c1"># WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
<span class="c1"># See the License for the specific language governing permissions and</span>
<span class="c1"># limitations under the License.</span>
<span class="c1">##############################################################################</span>

<span class="sd">&quot;&quot;&quot;An awesome colormap for really neat visualizations.&quot;&quot;&quot;</span>

<span class="kn">from</span> <span class="nn">__future__</span> <span class="k">import</span> <span class="n">absolute_import</span>
<span class="kn">from</span> <span class="nn">__future__</span> <span class="k">import</span> <span class="n">division</span>
<span class="kn">from</span> <span class="nn">__future__</span> <span class="k">import</span> <span class="n">print_function</span>
<span class="kn">from</span> <span class="nn">__future__</span> <span class="k">import</span> <span class="n">unicode_literals</span>

<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>


<div class="viewcode-block" id="colormap"><a class="viewcode-back" href="../../../argoverse.visualization.html#argoverse.visualization.colormap.colormap">[docs]</a><span class="k">def</span> <span class="nf">colormap</span><span class="p">(</span><span class="n">rgb</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
    <span class="n">color_list</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span>
        <span class="p">[</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.447</span><span class="p">,</span> <span class="mf">0.741</span><span class="p">,</span>
            <span class="mf">0.850</span><span class="p">,</span> <span class="mf">0.325</span><span class="p">,</span> <span class="mf">0.098</span><span class="p">,</span>
            <span class="mf">0.929</span><span class="p">,</span> <span class="mf">0.694</span><span class="p">,</span> <span class="mf">0.125</span><span class="p">,</span>
            <span class="mf">0.494</span><span class="p">,</span> <span class="mf">0.184</span><span class="p">,</span> <span class="mf">0.556</span><span class="p">,</span>
            <span class="mf">0.466</span><span class="p">,</span> <span class="mf">0.674</span><span class="p">,</span> <span class="mf">0.188</span><span class="p">,</span>
            <span class="mf">0.301</span><span class="p">,</span> <span class="mf">0.745</span><span class="p">,</span> <span class="mf">0.933</span><span class="p">,</span>
            <span class="mf">0.635</span><span class="p">,</span> <span class="mf">0.078</span><span class="p">,</span> <span class="mf">0.184</span><span class="p">,</span>
            <span class="mf">0.300</span><span class="p">,</span> <span class="mf">0.300</span><span class="p">,</span> <span class="mf">0.300</span><span class="p">,</span>
            <span class="mf">0.600</span><span class="p">,</span> <span class="mf">0.600</span><span class="p">,</span> <span class="mf">0.600</span><span class="p">,</span>
            <span class="mf">1.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">1.000</span><span class="p">,</span> <span class="mf">0.500</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">0.749</span><span class="p">,</span> <span class="mf">0.749</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span>
            <span class="mf">0.667</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span>
            <span class="mf">0.333</span><span class="p">,</span> <span class="mf">0.333</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">0.333</span><span class="p">,</span> <span class="mf">0.667</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">0.333</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">0.667</span><span class="p">,</span> <span class="mf">0.333</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">0.667</span><span class="p">,</span> <span class="mf">0.667</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">0.667</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">1.000</span><span class="p">,</span> <span class="mf">0.333</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">1.000</span><span class="p">,</span> <span class="mf">0.667</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">1.000</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.333</span><span class="p">,</span> <span class="mf">0.500</span><span class="p">,</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.667</span><span class="p">,</span> <span class="mf">0.500</span><span class="p">,</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span> <span class="mf">0.500</span><span class="p">,</span>
            <span class="mf">0.333</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.500</span><span class="p">,</span>
            <span class="mf">0.333</span><span class="p">,</span> <span class="mf">0.333</span><span class="p">,</span> <span class="mf">0.500</span><span class="p">,</span>
            <span class="mf">0.333</span><span class="p">,</span> <span class="mf">0.667</span><span class="p">,</span> <span class="mf">0.500</span><span class="p">,</span>
            <span class="mf">0.333</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span> <span class="mf">0.500</span><span class="p">,</span>
            <span class="mf">0.667</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.500</span><span class="p">,</span>
            <span class="mf">0.667</span><span class="p">,</span> <span class="mf">0.333</span><span class="p">,</span> <span class="mf">0.500</span><span class="p">,</span>
            <span class="mf">0.667</span><span class="p">,</span> <span class="mf">0.667</span><span class="p">,</span> <span class="mf">0.500</span><span class="p">,</span>
            <span class="mf">0.667</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span> <span class="mf">0.500</span><span class="p">,</span>
            <span class="mf">1.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.500</span><span class="p">,</span>
            <span class="mf">1.000</span><span class="p">,</span> <span class="mf">0.333</span><span class="p">,</span> <span class="mf">0.500</span><span class="p">,</span>
            <span class="mf">1.000</span><span class="p">,</span> <span class="mf">0.667</span><span class="p">,</span> <span class="mf">0.500</span><span class="p">,</span>
            <span class="mf">1.000</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span> <span class="mf">0.500</span><span class="p">,</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.333</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.667</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span>
            <span class="mf">0.333</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span>
            <span class="mf">0.333</span><span class="p">,</span> <span class="mf">0.333</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span>
            <span class="mf">0.333</span><span class="p">,</span> <span class="mf">0.667</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span>
            <span class="mf">0.333</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span>
            <span class="mf">0.667</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span>
            <span class="mf">0.667</span><span class="p">,</span> <span class="mf">0.333</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span>
            <span class="mf">0.667</span><span class="p">,</span> <span class="mf">0.667</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span>
            <span class="mf">0.667</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span>
            <span class="mf">1.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span>
            <span class="mf">1.000</span><span class="p">,</span> <span class="mf">0.333</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span>
            <span class="mf">1.000</span><span class="p">,</span> <span class="mf">0.667</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span>
            <span class="mf">0.167</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">0.333</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">0.500</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">0.667</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">0.833</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">1.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.167</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.333</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.500</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.667</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.833</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.167</span><span class="p">,</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.333</span><span class="p">,</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.500</span><span class="p">,</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.667</span><span class="p">,</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.833</span><span class="p">,</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span>
            <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span> <span class="mf">0.000</span><span class="p">,</span>
            <span class="mf">0.143</span><span class="p">,</span> <span class="mf">0.143</span><span class="p">,</span> <span class="mf">0.143</span><span class="p">,</span>
            <span class="mf">0.286</span><span class="p">,</span> <span class="mf">0.286</span><span class="p">,</span> <span class="mf">0.286</span><span class="p">,</span>
            <span class="mf">0.429</span><span class="p">,</span> <span class="mf">0.429</span><span class="p">,</span> <span class="mf">0.429</span><span class="p">,</span>
            <span class="mf">0.571</span><span class="p">,</span> <span class="mf">0.571</span><span class="p">,</span> <span class="mf">0.571</span><span class="p">,</span>
            <span class="mf">0.714</span><span class="p">,</span> <span class="mf">0.714</span><span class="p">,</span> <span class="mf">0.714</span><span class="p">,</span>
            <span class="mf">0.857</span><span class="p">,</span> <span class="mf">0.857</span><span class="p">,</span> <span class="mf">0.857</span><span class="p">,</span>
            <span class="mf">1.000</span><span class="p">,</span> <span class="mf">1.000</span><span class="p">,</span> <span class="mf">1.000</span>
        <span class="p">]</span>
    <span class="p">)</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span>
    <span class="n">color_list</span> <span class="o">=</span> <span class="n">color_list</span><span class="o">.</span><span class="n">reshape</span><span class="p">((</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">))</span> <span class="o">*</span> <span class="mi">255</span>
    <span class="k">if</span> <span class="ow">not</span> <span class="n">rgb</span><span class="p">:</span>
        <span class="n">color_list</span> <span class="o">=</span> <span class="n">color_list</span><span class="p">[:,</span> <span class="p">::</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
    <span class="k">return</span> <span class="n">color_list</span></div>
</pre></div>

           </div>
           
          </div>
          <footer>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2019, Argo AI, LLC

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>